<template>
    <view class="main ">
        <view class="box dispaly-center" style="margin-bottom: 20rpx;">
            <view class="cover">
                <image src="/static/mine/wx.png" mode="aspectFill" />
            </view>
            <view class="dispaly-just-between r">
                <view class="left">
                    <view class="name">微信收款码</view>
                    <view class="b">{{ userInfo.wxQr ? '已绑定' : '未绑定' }}</view>
                </view>
                <view class="right dispaly-align-center" @click="$goUrl('/subPackage/mine/editCode')">编辑</view>
            </view>
        </view>

        <view class="box dispaly-center">
            <view class="cover">
                <image src="/static/mine/zfb.png" mode="aspectFill" />
            </view>
            <view class="dispaly-just-between r">
                <view class="left">
                    <view class="name">支付宝收款码</view>
                    <view class="b">{{ userInfo.aliQr ? '已绑定' : '未绑定' }}</view>
                </view>
                <view class="right dispaly-align-center" @click="$goUrl('/subPackage/mine/editCodeOne')">编辑</view>
            </view>
        </view>

    </view>
</template>

<script setup>
import { onShow } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { getUserInfo } from '@/api/apiList';

const userInfo = ref({})
const getUser = async () => {
    const res = await getUserInfo({ userId: '' })
    if (res.code == 200) {
        userInfo.value = res.data
        uni.setStorageSync('user', userInfo.value)
    }
}

onShow(() => {
    getUser()
})

</script>
<style lang="scss" scoped>
.main {
    padding: 30rpx;

    .box {
        background: #FFFFFF;
        border-radius: 12rpx;
        padding: 30rpx;

        .cover {
            margin-right: 21rpx;

            image {
                width: 60rpx;
                height: 52rpx;
            }
        }

        .r {
            width: 100%;

            .left {
                .name {
                    font-family: PingFang-SC, PingFang-SC;
                    font-weight: 500;
                    font-size: 30rpx;
                    color: #111111;
                }

                .b {
                    font-family: PingFang-SC, PingFang-SC;
                    font-weight: 500;
                    font-size: 26rpx;
                    color: #999999;
                }
            }

            .right {
                width: 120rpx;
                height: 48rpx;
                background: #3E89FA;
                border-radius: 24rpx;
                font-family: PingFang-SC, PingFang-SC;
                font-weight: 500;
                font-size: 24rpx;
                color: #FFFFFF;
            }
        }
    }
}
</style>